<?php
// +----------------------------------------------------------------------
// | HisiPHP框架[基于ThinkPHP5.1开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2016-2021 http://www.hisiphp.com
// +----------------------------------------------------------------------
// | HisiPHP承诺基础框架永久免费开源，您可用于学习和商用，但必须保留软件版权信息。
// +----------------------------------------------------------------------
// | Author: 橘子俊 <364666827@qq.com>，开发者QQ群：50304283
// +----------------------------------------------------------------------

namespace app\api\validate;

use think\Validate;


class RtcAnchorValidate extends Validate
{
    //定义验证规则
    protected $rule = [
        'id|id' => 'require',
        'uid|用户id' => 'require',
        'channel_id|频道id' => 'require',
        'wheat_duration|抢麦时长(秒)' => 'require',
        'num|正式成员人数' => 'require',
        'name|频道名称' => 'require',
        'game_category_id|游戏分类id' => 'require',
        'channel_announcement|频道公告' => 'require',
        'is_prohibit_wheat|禁麦' => 'require',
        'is_control_wheat|控麦' => 'require',
        'game_category_id|分类id' => 'require',
        'page|page' => 'require',
        'limit|每页条数' => 'require',
    ];

    //定义验证提示
    protected $message = [
        'id.require' => '缺少参数id',
        'uid.require' => '缺少参数uid',
        'channel_id.require' => '缺少参数 频道 channel_id',
        'wheat_duration.require' => '缺少参数 抢麦时长(秒)',
        'num.require' => '缺少参数 正式成员人数',
        'name.require' => '缺少参数 频道名称',
        'game_category_id.require' => '缺少参数 游戏分类id',
        'channel_announcement.require' => '缺少参数 频道公告',
        'is_prohibit_wheat.require' => '缺少参数 禁麦',
        'is_control_wheat.require' => '缺少参数 控麦',
        'page.require' => '缺少参数 page',
        'limit.require' => '缺少参数 limit',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add' => [ 'wheat_duration', 'num', 'name', 'game_category_id', 'channel_announcement'],
        'getToken'=>['channel_id'],
        'update' => [ 'channel_id', 'channel_announcement'],
        'del' => ['id'],
        'tichu' => [ 'channel_id', 'terminal_ids'],
        'edit'=>['id'],
        'prohibitWheat' =>[ 'channel_id', 'is_prohibit_wheat'],
        'controlWheat' =>[ 'channel_id', 'is_control_wheat'],
        'isHomeowner' =>[ 'channel_id'],
        'isCanTalk' =>[ 'channel_id'],
        'list' =>[ 'game_category_id','page','limit'],
        'details'=>['channel_id']
    ];


}
